! function (t) {
    var e = {};

    function r(o) {
        if (e[o]) return e[o].exports;
        var n = e[o] = {
            i: o,
            l: !1,
            exports: {}
        };
        return t[o].call(n.exports, n, n.exports, r), n.l = !0, n.exports
    }
    r.m = t, r.c = e, r.d = function (t, e, o) {
        r.o(t, e) || Object.defineProperty(t, e, {
            enumerable: !0,
            get: o
        })
    }, r.r = function (t) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
            value: "Module"
        }), Object.defineProperty(t, "__esModule", {
            value: !0
        })
    }, r.t = function (t, e) {
        if (1 & e && (t = r(t)), 8 & e) return t;
        if (4 & e && "object" == typeof t && t && t.__esModule) return t;
        var o = Object.create(null);
        if (r.r(o), Object.defineProperty(o, "default", {
                enumerable: !0,
                value: t
            }), 2 & e && "string" != typeof t)
            for (var n in t) r.d(o, n, function (e) {
                return t[e]
            }.bind(null, n));
        return o
    }, r.n = function (t) {
        var e = t && t.__esModule ? function () {
            return t.default
        } : function () {
            return t
        };
        return r.d(e, "a", e), e
    }, r.o = function (t, e) {
        return Object.prototype.hasOwnProperty.call(t, e)
    }, r.p = ".", r(r.s = 3)
}([function (t, e) {
    t.exports = function (t) {
        return t && t.__esModule ? t : {
            default: t
        }
    }
}, function (t, e, r) {
    "use strict";
    var o = r(0)(r(0));
    Object.defineProperty(e, "__esModule", {
        value: !0
    }), e.decipher = e.cipher = e.fetch_retry = e.fetchWithTimeout = void 0;
    var n = r(2),
        i = (0, o.default)(n);

    function c(t, e) {
        var r = Object.keys(t);
        if (Object.getOwnPropertySymbols) {
            var o = Object.getOwnPropertySymbols(t);
            e && (o = o.filter((function (e) {
                return Object.getOwnPropertyDescriptor(t, e).enumerable
            }))), r.push.apply(r, o)
        }
        return r
    }

    function a(t) {
        for (var e = 1; e < arguments.length; e++) {
            var r = null != arguments[e] ? arguments[e] : {};
            e % 2 ? c(Object(r), !0).forEach((function (e) {
                (0, i.default)(t, e, r[e])
            })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : c(Object(r)).forEach((function (e) {
                Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e))
            }))
        }
        return t
    }
    var u = e.fetchWithTimeout = function (t) {
        var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
            r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 5e3,
            o = new AbortController,
            n = a({}, e, {
                signal: o.signal
            });
        setTimeout((function () {
            o.abort()
        }), r);
        return fetch(t, n).then((function (t) {
            if (!t.ok) throw new Error("".concat(t.status, ": ").concat(t.statusText));
            return t
        })).catch((function (t) {
            if ("AbortError" === t.name) throw new Error("Response timed out");
            throw new Error(t.message)
        }))
    };
    e.fetch_retry = function t(e, r, o) {
        var n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1;
        return u(e, r, o).catch((function (i) {
            if (1 === n) throw i;
            return t(e, r, o, n - 1)
        }))
    }, e.cipher = function (t) {
        var e = function (t) {
                return t.split("").map((function (t) {
                    return t.charCodeAt(0)
                }))
            },
            r = function (t) {
                return ("0" + Number(t).toString(16)).substr(-2)
            },
            o = function (r) {
                return e(t).reduce((function (t, e) {
                    return t ^ e
                }), r)
            };
        return function (t) {
            return t.split("").map(e).map(o).map(r).join("")
        }
    }, e.decipher = function (t) {
        var e = function (e) {
            return (r = t, r.split("").map((function (t) {
                return t.charCodeAt(0)
            }))).reduce((function (t, e) {
                return t ^ e
            }), e);
            var r
        };
        return function (t) {
            return t.match(/.{1,2}/g).map((function (t) {
                return parseInt(t, 16)
            })).map(e).map((function (t) {
                return String.fromCharCode(t)
            })).join("")
        }
    }
}, function (t, e) {
    t.exports = function (t, e, r) {
        return e in t ? Object.defineProperty(t, e, {
            value: r,
            enumerable: !0,
            configurable: !0,
            writable: !0
        }) : t[e] = r, t
    }
}, function (t, e, r) {
    "use strict";
    Object.defineProperty(e, "__esModule", {
        value: !0
    }), e.DISABLE_DOWNLOADING_FROM_YOUTUBE_REGEXP = e.supportedLanguages = e.t = e.PRE_DEF_EXTS = e.YTDLPAGE = e.HOMEPAGE = e.ISEDGE = e.PROENV = void 0, e.doInit = function () {
        if (void 0 === localStorage[c] || "" == localStorage[c]) {
            var t = new Array({
                ext: "flv",
                size: 10
            }, {
                ext: "hlv",
                size: 10
            }, {
                ext: "f4v",
                size: 10
            }, {
                ext: "mp4",
                size: 10
            }, {
                ext: "mp3",
                size: 10
            }, {
                ext: "wma",
                size: 10
            }, {
                ext: "wav",
                size: 10
            }, {
                ext: "m4a",
                size: 10
            }, {
                ext: "webm",
                size: 10
            }, {
                ext: "ogg",
                size: 10
            }, {
                ext: "ogv",
                size: 10
            }, {
                ext: "acc",
                size: 10
            }, {
                ext: "mov",
                size: 10
            }, {
                ext: "mkv",
                size: 10
            }, {
                ext: "m3u8",
                size: 0
            }, {
                ext: "ts",
                size: 1e11
            });
            localStorage[c] = JSON.stringify(t)
        }
        if (void 0 === localStorage.Type) {
            var e = new Array({
                Type: "video/*",
                size: 2048
            }, {
                Type: "audio/*",
                size: 10
            });
            localStorage.Type = JSON.stringify(e)
        }
        if (void 0 === localStorage.BlockedDomains) {
            var r = new Array;
            localStorage.BlockedDomains = JSON.stringify(r)
        }
        void 0 === localStorage.repeat && (localStorage.repeat = !1);
        void 0 === localStorage.repeatReg && (localStorage.repeatReg = "\\?[\\S]+");
        void 0 === localStorage.Debug && (localStorage.Debug = !1);
        void 0 === localStorage.TitleName && (localStorage.TitleName = !1);
        void 0 === localStorage.popListCount && (localStorage.popListCount = 30);
        void 0 === localStorage.showCountOnIcon && (localStorage.showCountOnIcon = !0)
    }, e.tr = function (t) {
        $("#" + t).html(a(t))
    }, e.getLanguage = l, e.getExtManifest = function () {
        return n.runtime.getManifest()
    }, e.isActivePro = p, e.getLoaderUrl = function () {
        var t, e, r = l(),
            o = "://www.cnbbx.com/";
        t = "other" != r ? "hls.html" : "ohls.html";
        p() && (o = "://www.cnbbx.com/", t = "hls.vhtml", "other" == r && (t = "ohls.vhtml"));
        e = i ? o + (u.includes(r) ? r + "/" : "") + t : "://127.0.0.1/" + t;
        return e
    }, e.getDLMUrl = function () {
        var t, e, r = l(),
            o = "://www.cnbbx.com/";
        t = "other" != r ? "dlm.html" : "odlm.html";
        p() && (o = "://www.cnbbx.com/", t = "dlm.vhtml", "other" == r && (t = "odlm.vhtml"));
        e = i ? o + "dlm/" + (u.includes(r) ? r + "/" : "") + t : "://127.0.0.1/dlm/" + t;
        return e
    };
    var o = r(1),
        n = navigator.userAgent.includes("Chrome") ? chrome : browser,
        i = e.PROENV = !0;
    e.ISEDGE = !1, e.HOMEPAGE = void 0, e.YTDLPAGE = void 0;
    i ? (e.HOMEPAGE = "https://www.cnbbx.com", e.YTDLPAGE = "https://www.cnbbx.com/yt/") : (console.log("dev env"), e.HOMEPAGE = "http://127.0.0.1", e.YTDLPAGE = "http://127.0.0.1");
    var c = e.PRE_DEF_EXTS = "Ext04";
    n.browserAction.setIcon({
        path: {
            16: "assets/icons/16x16_gray.png",
            32: "assets/icons/32x32_gray.png",
            48: "assets/icons/48x48_gray.png",
            64: "assets/icons/64x64_gray.png",
            128: "assets/icons/128x128_gray.png"
        }
    });
    var a = e.t = n.i18n.getMessage;
    var u = e.supportedLanguages = ["zh_tw", "zh_cn"];

    function l() {
        var t = n.i18n.getUILanguage();
        return t.match(/zh-CN/) ? "zh_cn" : t.match(/zh-TW/) ? "zh_tw" : t.startsWith("zh") ? "zh_cn" : t.startsWith("en") ? t.substr(0, 2) : "other"
    }
    if (n.runtime.onInstalled.addListener((function (t) {
            var e = l(),
                r = "https://www.cnbbx.com/" + (u.includes(e) ? e + "/" : "") + "installed.html";
            localStorage.getItem("installed") || n.tabs.create({
                url: r
            }, (function (t) {
                console.log("Hi, wellcome:)"), localStorage.setItem("installed", "t")
            }))
        })), n.runtime.setUninstallURL) {
        var s = l(),
            f = "https://www.cnbbx.com/" + (u.includes(s) ? s + "/" : "") + "uninstalled.html";
        n.runtime.setUninstallURL(f)
    }
    e.DISABLE_DOWNLOADING_FROM_YOUTUBE_REGEXP = /^https?:\/\/www\.youtube\.com\//;

    function p() {
        if (localStorage.getItem("pui") && "active" == (0, o.decipher)("CocoCut pro user")(localStorage.getItem("pui")).split("|")[3]) return !0;
        return !1
    }
}]);